package org.example.trans.demos.test;

import lombok.extern.slf4j.Slf4j;
import org.example.trans.demos.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class UserService {
    @Autowired
    private UserInfoMapper userInfoMapper ;


    @Transactional(propagation = Propagation.NESTED)
    public void insertUser (){
        UserInfo userInfo = new UserInfo() ;
        userInfo.setUserName("t1");
        userInfo.setPassword("t1");
        userInfoMapper.insertUser(userInfo) ;
    }


}
